﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ClassLibrary1.DAO;
using ClassLibrary1.Entity;

namespace Bilyteam_Website.Admin
{
    public partial class ProviceEdit : System.Web.UI.Page
    {
         private Provices provInfo;
        private ProvicesDAO provdao;
        public ProviceEdit()
        {
            provInfo= new Provices();
            provdao= new ProvicesDAO();
        }
        protected void Page_Load(object sender, EventArgs e)
        {

            if (!IsPostBack)
            {
                string ID = Request["provID"];
                if (ID != null)
                {
                    provInfo = provdao.GetProvByID(ID);
                    tbproviceid.Text = ID;
                    tbprovicesname.Text = provInfo.ProviceName.ToString();

                }
            }
        }

        protected void btnsave_Click(object sender, EventArgs e)
        {
            Provices prov = new Provices();
            prov.ProviceID = tbproviceid.Text;
            prov.ProviceName = tbprovicesname.Text;
            provdao.Update(prov);
            Response.Redirect("ProvicesManager.aspx");
        }
    }
}